all: rational

rational: main.o rational.o
	g++ main.o rational.o -o rational

main.o: main.cpp rational.h
	g++ -c main.cpp -Wall -o main.o

rational.o: rational.cpp rational.h
	g++ -c rational.cpp -Wall -o rational.o

clean:
	rm -f *.o rational

.PHONY: all clean
